import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.beans.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import javax.swing.ComboBoxModel;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JComboBox;

import org.jdesktop.swingx.autocomplete.ComboBoxAdaptor;

import farmacia.dao.ProdutoDao;
import farmacia.dao.SubstanciaDao;
import farmacia.entidade.estoque.Produto;
import farmacia.entidade.estoque.Substancia;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class Jcompobox1 extends JFrame {
	List<Substancia> disponiveis;
	private JPanel contentPane;
	JComboBox cb;
	private Connection conexao;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Jcompobox1 frame = new Jcompobox1();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 * @throws SQLException 
	 */
	
	
	
	public Jcompobox1() throws SQLException {

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
	    cb = new JComboBox(new SubstanciaDao().getListaComboPlaca());
	    cb.addMouseListener(new MouseAdapter() {
	    	@Override
	    	public void mouseReleased(MouseEvent e) {
	    	
	    	}
	    	@Override
	    	public void mouseClicked(MouseEvent e) {
	    		
	    	}
	    });
		cb.setBounds(123, 62, 199, 23);
		panel.add(cb);
	}
	
	
		
    

}
